.. _ocastatesensor: 1.1.2.12 OcaStateSensor ======================== Class Hierarchy: :ref:`OcaRoot ` : :ref:`OcaWorker ` : :ref:`OcaSensor ` : :ref:`OcaStateSensor ` .. cpp:class:: OcaStateSensor: OcaSensor Sensor that reports a 1-of-n state. Sensor counterpart of the actuator **OcaSwitch**. **Properties**: .. _ocastatesensor_classid: .. cpp:member:: static const OcaClassID ClassID = "1.1.2.12" Number that uniquely identifies the class. Note that this differs from the object number, which identifies the instantiated object. This property is an override of the **OcaRoot** property. This property has id ``1.1``. .. _ocastatesensor_classversion: .. cpp:member:: static const OcaClassVersionNumber ClassVersion = 1 Identifies the interface version of the class. Any change to the class definition leads to a higher class version. This property is an override of the **OcaRoot** property. This property has id ``1.2``. .. _ocastatesensor_state: .. cpp:member:: OcaUint16 State The current state reading. States shall be numbered from **minState** to (including) **maxState**, as returned by the **GetState(...)** method. This property has id ``4.1``. .. _ocastatesensor_statenames: .. cpp:member:: OcaList StateNames Vector of state names. May be readonly or readwrite, depending on implementation. FIrst element of list corresponds to the state value of **minState** as returned by **GetState(...)**. This property has id ``4.2``. Properties inherited from :ref:`ocasensor`: - :cpp:texpr:`OcaClassID` :ref:`OcaRoot::ClassID ` - :cpp:texpr:`OcaClassVersionNumber` :ref:`OcaRoot::ClassVersion ` - :cpp:texpr:`OcaBoolean` :ref:`OcaRoot::Lockable ` - :cpp:texpr:`OcaLockState` :ref:`OcaRoot::LockState ` - :cpp:texpr:`OcaONo` :ref:`OcaRoot::ObjectNumber ` - :cpp:texpr:`OcaString` :ref:`OcaRoot::Role ` - :cpp:texpr:`OcaClassID` :ref:`OcaWorker::ClassID ` - :cpp:texpr:`OcaClassVersionNumber` :ref:`OcaWorker::ClassVersion ` - :cpp:texpr:`OcaBoolean` :ref:`OcaWorker::Enabled ` - :cpp:texpr:`OcaString` :ref:`OcaWorker::Label ` - :cpp:texpr:`OcaTimeInterval` :ref:`OcaWorker::Latency ` - :cpp:texpr:`OcaONo` :ref:`OcaWorker::Owner ` - :cpp:texpr:`OcaMap` :ref:`OcaWorker::PortClockMap ` - :cpp:texpr:`OcaList` :ref:`OcaWorker::Ports ` - :cpp:texpr:`OcaClassID` :ref:`OcaSensor::ClassID ` - :cpp:texpr:`OcaClassVersionNumber` :ref:`OcaSensor::ClassVersion ` - :cpp:texpr:`OcaSensorReadingState` :ref:`OcaSensor::ReadingState ` **Methods**: .. _ocastatesensor_getstate: .. cpp:function:: OcaStatus GetState(OcaUint16 &State, OcaUint16 &minState, OcaUint16 &maxState) Gets the value of the State property and, optionally, its implementation min and max. This method has id ``4.1``. - :cpp:expr:`State`: Output parameter. - :cpp:expr:`minState`: Output parameter. - :cpp:expr:`maxState`: Output parameter. .. _ocastatesensor_getstatenames: .. cpp:function:: OcaStatus GetStateNames(OcaList &Names) Gets list of names assigned to the States. This method has id ``4.2``. - :cpp:expr:`Names`: Output parameter. .. _ocastatesensor_setstatenames: .. cpp:function:: OcaStatus SetStateNames(OcaList Names) Value to which the StateNames property shall be set if the method succeeds. Optional method - StateNames may be readonly in some implementations. This method has id ``4.3``. - :cpp:expr:`Names`: Input parameter. Methods inherited from :ref:`ocasensor`: - :ref:`OcaSensor::GetClassIdentification ` - :ref:`OcaSensor::GetLockable ` - :ref:`OcaSensor::GetLockState ` - :ref:`OcaSensor::GetRole ` - :ref:`OcaSensor::SetLockNoWrite ` - :ref:`OcaSensor::SetLockNoReadWrite ` - :ref:`OcaSensor::Unlock ` - :ref:`OcaSensor::AddPort ` - :ref:`OcaSensor::DeletePort ` - :ref:`OcaSensor::DeletePortClockMapEntry ` - :ref:`OcaSensor::GetEnabled ` - :ref:`OcaSensor::GetLabel ` - :ref:`OcaSensor::GetLatency ` - :ref:`OcaSensor::GetOwner ` - :ref:`OcaSensor::GetPath ` - :ref:`OcaSensor::GetPortClockMap ` - :ref:`OcaSensor::GetPortClockMapEntry ` - :ref:`OcaSensor::GetPortName ` - :ref:`OcaSensor::GetPorts ` - :ref:`OcaSensor::SetEnabled ` - :ref:`OcaSensor::SetLabel ` - :ref:`OcaSensor::SetLatency ` - :ref:`OcaSensor::SetPortClockMap ` - :ref:`OcaSensor::SetPortClockMapEntry ` - :ref:`OcaSensor::SetPortName ` - :ref:`OcaSensor::GetReadingState `